<?php

/* Author: Panos Sakkos
 * Deletes entity with the target entity id
 */

function BL_delete_entity($categoryId, $entityId, $userId)
{
    $category = DB_getCategory($categoryId);
    $owner = $category->GetOwner();
    $entity = DB_getEntity($entityId);

    //cross exam if the user that wants to delete the category is it's owners
    if ($userId == $category->GetOwner())
    {
        DB_category_deleteentity($entityId);
        return BL_OK;
    }
    else
        return BL_NOT_OWNER;
}

?>